package 线程的状态;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2022-11-18
 * Time: 10:39
 */
public class Priority {

    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            int count = 0;
            for(;;){
                System.out.println("t1:                "+count++);
            }
        });
        Thread t2 = new Thread(()->{
            int count = 0;
            for(;;){
                System.out.println("                t2 : "  + count++);
            }
        });
        t1.setPriority(Thread.MIN_PRIORITY);//最小优先级--> 1
        t2.setPriority(Thread.MAX_PRIORITY);//最高优先级--> 10
        t1.start();
        t2.start();
    }

}
